package com.fjd.mapper;

import com.fjd.entity.ShoppingCart;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ShoppingCartMapper {
    @Select("select * from shopping_cart where customer_id =#{customerId}")
    List<ShoppingCart> getByCustomerId(String customerId);

    @Insert("insert into shopping_cart (id, customer_id, merchandise_id, merchandise_price, merchandise_amount, merchandise_price_amount) values " +
            "(#{id},#{customerId},#{merchandiseId},#{merchandisePrice},#{merchandiseAmount},#{merchandisePriceAmount})")
    void insert(ShoppingCart shoppingCart);


    void deleteByIds(List<String> ids);
}
